<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html class=" -webkit-">
<head>
<meta charset="utf-8">
<title>杰利联合</title>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<meta
	content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"
	name="viewport">
<meta content="application/xhtml+xml;charset=UTF-8"
	http-equiv="Content-Type">
<meta content="no-cache,must-revalidate" http-equiv="Cache-Control">
<meta content="no-cache" http-equiv="pragma">
<meta content="0" http-equiv="expires">
<meta content="telephone=no, address=no" name="format-detection">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style"
	content="black-translucent">
<link
	href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css"
	rel="stylesheet" />

<link rel="stylesheet" type="text/css"
	href="${ctxStatic}/jiu/css/mobile_module.css?v=1493085388" media="all">
<script type="text/javascript"
	src="${ctxStatic}/jiu/js/jquery-2.0.3.min.js"></script>
<!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 -->
<script
	src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script type="text/javascript"
	src="${ctxStatic}/jiu/js/prefixfree.min.js?v=1493085388"></script>
<script type="text/javascript"
	src="${ctxStatic}/jiu/js/dialog.js?v=1493085388"></script>
<script type="text/javascript"
	src="${ctxStatic}/jiu/js/flipsnap.min.js?v=1493085388"></script>
<script type="text/javascript"
	src="${ctxStatic}/jiu/js/mobile_module.js?v=1493085388"></script>
<link href="${ctxStatic}/jiu/css/common.css?v=1493085388"
	rel="stylesheet" type="text/css">
<style>
.yin {
	background-color: rgba(0, 0, 0, 0.5);
	width: 100%;
	height: 100%;
	position: fixed;
	top: 0;
	left: 0;
	z-index: 9999;
	display: none;
}

.loading {
	line-height: 50px;
	width: 200px;
	height: 50px;
	display: none;
	background-color: rgba(23, 21, 21, 0.51);
	position: fixed;
	top: 50%;
	left: 50%;
	margin: -25px 0 0 -100px;
	z-index: 10000;
	border-radius: 5px;
	-webkit-border-radius: 5px;
	color: #fff;
	text-align: center;
}
</style>
</head>
<body>
	<div class="container">
	  		<div class="modal fade" style="margin-top: 30%;" id="myModal"
			tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
			<div class="modal-dialog" role="document">
				<div class="modal-content">
					<div class="modal-header" style="width:100%;position:relative">
						<button type="button" class="close" data-dismiss="modal"
							aria-label="Close" style="position:absolute;right:10px;text-align:right">
							<span aria-hidden="true">&times;</span>
						</button>
						<h4 class="modal-title" id="myModalLabel">操作提示</h4>
					</div>
					<div class="modal-body"></div>
					<div class="modal-footer" style="display:flex;justify-content:space-between;" >
						<button type="button" class="btn btn-success" data-dismiss="modal"
							id="yes" style="width:100px">确定</button>
						<button style="width:100px;background:red;" type="button" class="btn btn-danger" data-dismiss="modal"
							id="no">取消</button>
					</div>
				</div>
			</div>
		</div>
		<!-- 订单信息 -->
		<div class="order_info">
			<p class="t">订单编号：${jiuOrder.orderNo}</p>
			<ul>

				<li class="order_item"><img
					src="${ctxUser }/jiu/${jiuOrder.manufactorLogo}">
					<div class="info">
						<p class="name">${jiuOrder.manufactorName}</p>
						<p class="property">
							<span class="colorless">价格</span> <span class="orange">${jiuOrder.unitPrice}积分</span>
						</p>
						<p class="property">
							<span class="colorless">数量</span> <span>${jiuOrder.orderNum}</span>
						</p>
					</div></li>
			</ul>
			<p class="order_remark">撤销原因： ${jiuOrder.manApplyRevokeRemarks}</p>
			<input type="hidden" name="remark"
				value="${jiuOrder.manApplyRevokeRemarks}">
			<p class="total_price">
				<span class="orange">共${jiuOrder.totalPrice}积分</span>
			</p>
			<a style="margin-bottom: 10px;" class="btn blue_btn"
				href="javascript:void(0)" onclick="ajaxExamineRevoke(1)">确认撤销</a> <a
				class="btn" href="javascript:void(0)" onclick="ajaxExamineRevoke(2)">取消撤销</a><br>
		</div>
	</div>

	<div class="yin"></div>
	<div class="loading">
		<img alt="" src="${ctxStatic}/jiu/img/icon32_loading_dark.gif">正在提交，请稍后...
	</div>
	<script>
		$(document).ready(function() {
			$('.btn').click(function() {
				$('.loading').fadeIn().delay(3000).fadeOut();
				$('.yin').fadeIn(300).delay(3000).fadeOut();
			})
		});
	</script>

	<script type="text/javascript">
		window.alert = function(name) {
			var iframe = document.createElement("IFRAME");
			iframe.style.display = "none";
			iframe.setAttribute("src", 'data:text/plain,');
			document.documentElement.appendChild(iframe);
			window.frames[0].window.alert(name);
			iframe.parentNode.removeChild(iframe);
		};

		window.confirm = function(message) {
			var iframe = document.createElement("IFRAME");
			iframe.style.display = "none";
			iframe.setAttribute("src", 'data:text/plain,');
			document.documentElement.appendChild(iframe);
			var alertFrame = window.frames[0];
			var result = alertFrame.window.confirm(message);
			iframe.parentNode.removeChild(iframe);
			return result;
		};

		var tag = 0;
		function ajaxExamineRevoke(type) {
			if (tag == 1) {
				return;
			}
			$('.loading').show();
			var remark = $('input[name=remark]').val();
			tag = 1;
			$
					.getJSON(
							"${ctxFront }/jiu/ajaxExamineRevoke",
							{
								orderId : "${jiuOrder.id}",
								type : type,
								remarks : remark
							},
							function(data) {
								if (data.msg == 'success') {
									$('.loading').hide();
									$('#myModal').modal('show');
									$(".modal-body").text(data.message);
									$("#yes").click(function(){
										window.location.href = "${ctxFront }/jiu/factoryOrder?uid=${uid}&v="
											+ Math.random();
									});
									
								}
							});

		}
	</script>
</body>
</html>
